home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-23 | 1.7 KB | 24 lines | [TEXT/MPS ] |
- #!./perl
-
- # $Header: split.t,v 4.0 91/03/20 01:54:42 lwall Locked $
-
- print "1..12\n";
-
- $FS = ':';
-
- $_ = 'a:b:c';
-
- ($a,$b,$c) = split($FS,$_);
-
- if (join(';',$a,$b,$c) eq 'a;b;c') {print "ok 1\n";} else {print "not ok 1\n";}
-
- @ary = split(/:b:/);
- if (join("$_",@ary) eq 'aa:b:cc') {print "ok 2\n";} else {print "not ok 2\n";}
-
- $_ = "abc\n";
- @xyz = (@ary = split(//));
- if (join(".",@ary) eq "a.b.c.\n") {print "ok 3\n";} else {print "not ok 3\n";}
-
- $_ = "a:b:c::::";
- @ary = split(/:/);
- if (join(".",@ary) eq "a.b.c"